home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEV / I-Z / Lex.cpt / Lex / asu124.lxi < prev    next >
Text File  |  1990-06-14  |  503b  |  32 lines

  1. /* example from ASU p.124 */
  2. a    =    [a];
  3. b    =    [b];
  4. c    =    [c];
  5. d    =    [d];
  6. r    =    (a|b|c|d)* a b b;
  7. %{
  8. #include    <stdlib.h>
  9. #ifdef    THINK_C
  10. #include    <CONSOLE.H>
  11. #endif
  12. #define    _lmovb    _lmovb_debug
  13. extern    SHORTINT    _lmovb_debug();
  14.  
  15. main()
  16. {
  17.     int token_number;
  18. #ifdef    THINK_C
  19.     cecho2file("asu124.log",0, stdout);
  20. #endif
  21.     while(token_number = yylex())
  22.         printf("\nyylex returns %d\n", token_number);
  23.     printf("\nyylex returns NULL\n");
  24. }
  25. %}
  26. %%
  27. r         {    
  28.         printf((char *)"\nrecognized r\n");
  29.         return    1;
  30.         }
  31. %%
  32. void yyinit() {}